home *** CD-ROM | disk | FTP | other *** search
- Path: news.dfn.de!si-nic!usenet
- From: Markus Becker <becker@zess.uni-siegen.de>
- Newsgroups: comp.lang.c
- Subject: Re: #define, question from a beginner
- Date: Thu, 01 Feb 1996 11:50:32 +0100
- Organization: ZESS, Uni-GH-Siegen
- Message-ID: <31109AF8.423B@zess.uni-siegen.de>
- References: <ma-010296161301@mac147.maths.uwa.edu.au>
- NNTP-Posting-Host: becker.zess.uni-siegen.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- ma wrote:
- snip
- > I can use #define to replace single lines#14 and 18. The following works.
-
- > QUESTION: Can I use one single macro fiveLines to replace lines from 14 to
- > 18 inclusively? I tried the following but got rejected. Is there any way to
- > get around it? Note that lines 14 and 18 contain local variables.
-
- You must use the "line-continuation" character -> "\"
- to continue a macro over more than one line.
-
- > #define fiveLines printf("%d, ",j); \ // macro should include this first ==== here
- > /* comment is part of the macro \ // <- and here
- > the comment contains a few lines \ // <- and here
-
- and so on.
-
- Hope that helps.
- --
- Markus Becker http://www.zess.uni-siegen.de/private/becker/
- Zentrum fuer Sensorsysteme (ZESS)
- http://www.zess.uni-siegen.de/private/becker/win95
-